var pageParamStr = $.url().param('pageParam');
var pageParam = JSON.parse(pageParamStr);

var view = {
	data: pageParam
};

var vue_vm = new Vue({
	el: '#vue_vm',
	data: view,
	methods: {
				getSubsidizationValue:function(subsidization, subsidizationValue) {
					return subsidization=='无补助'? '': subsidizationValue;
				},
				getSubsidizationUnit:function(subsidization) {
					return subsidization=='饭卡补助'? '元': (subsidization=='包餐补助'?'天':'');
				},
				getSubsidizationText:function(subsidization, subsidizationValue) {
					return subsidization + this.getSubsidizationValue(subsidization, subsidizationValue) + this.getSubsidizationUnit(subsidization);
				},
				getConsDeductionText:function(consumptionWay, consDeductionWay) {
					if(!consumptionWay||consumptionWay=='') {
						consumptionWay = '半个月扣费';
					}
					return consumptionWay+consDeductionWay+'元';
				},
				//总共可扣月数
				getTotalMonths:function(todo) {
					return 12;
				},
				//剩余可扣月数
				getRemainMonths:function(todo) {
					return todo.surplusMonths;
				},
				//已扣月数
				getAlreadyUsedMonths:function(todo) {
					var alreadyUsedMonths = this.getTotalMonths(todo) - this.getRemainMonths(todo);
					return alreadyUsedMonths;
				},
				//总共可扣次数
				getTotalNumber:function(todo) {
					if(todo.consumptionWay=='半个月扣费') {
						return 24;
					}else {
						return 12;
					}
				},
				//剩余可扣次数
				getRemainNumber:function(todo) {
					return todo.buckleNumber;
				},
				//已扣次数
				getAlreadyUsedNumber:function(todo) {
					var alreadyUsedNumber = this.getTotalNumber(todo) - this.getRemainNumber(todo);
					return alreadyUsedNumber;
				}
			}
});